﻿@model DHQGHN.PM2.Models.Online.TinhTrangHonNhanModel
<style>
    .ui-tooltip, .arrow:after {
        background: #FAFAD2;
    }

    .ui-tooltip {
        color: black;
        font-size: 12px;
    }

    .arrow {
        width: 70px;
        height: 16px;
        overflow: hidden;
        position: absolute;
        left: 50%;
        margin-left: -35px;
        bottom: -16px;
    }

        .arrow.top {
            top: -16px;
            bottom: auto;
        }

        .arrow.left {
            left: 20%;
        }

        .arrow:after {
            content: "";
            position: absolute;
            left: 20px;
            top: -20px;
            width: 25px;
            height: 25px;
            box-shadow: 6px 5px 9px -9px black;
            -webkit-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            transform: rotate(45deg);
        }

        .arrow.top:after {
            bottom: -20px;
            top: auto;
        }
</style>
<script>
    @functions{
        public string GetAntiForgeryToken()
        {
            string cookieToken, formToken;
            AntiForgery.GetTokens(null, out cookieToken, out formToken);
            return cookieToken + "," + formToken;
        }
    };
    $(document).ready(function () {
        Tooltip();
        $("#divLoading").show();
        $("#btnNext").attr("disabled", "disabled");
        $("#btnBack").attr("disabled", "disabled");
        key = $("#MARITAL_STATUS_ID").val();
        $("#MARRIAGE_REG_DAY").mask("99/99/9999", { placeholder: "dd/MM/yyyy" });
        Checkngay("DAYSP");
        Checkthang("MONTHSP");
        Checknam("YEARSP");
        Checkngay("DAYMR");
        Checkthang("MONTHMR");
        Checknam("YEARMR");
        Checkngay("DAYDI");
        Checkthang("MONTHDI");
        Checknam("YEARDI");
        Checkcmnd("SPOUSES_IDCARD_NUM");
        codemr = $("#CODEMR").val();
        tinhmr = $("#CODEMR").val().substring(0, 2);
        huyenmr = $("#CODEMR").val().substring(0, 5);
        codesp = $("#CODESP").val();
        tinhsp = $("#CODESP").val().substring(0, 2);
        huyensp = $("#CODESP").val().substring(0, 5);
        if (codemr != "") {
            $("#TINHMR").val(tinhmr);
        }
        if ($("#TINHMR").val() != "-1") {
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAdministrativeUnit1")', // we are calling json method
                headers: {
                    'VerificationToken': '@GetAntiForgeryToken()'
                },
                dataType: 'json',

                data: {
                    code: $("#TINHMR").val(),
                    level: '2'
                },
                success: function (states) {
                    $("#HUYENMR").append('<option value="' + '-1' + '">' +
                '-- Chọn Huyện --' + '</option>');
                    $.each(states, function (i, state) {
                        $("#HUYENMR").append('<option value="' + state.Value + '">' +
                             state.Text + '</option>');
                    });

                },
                complete: function () {
                    $("#HUYENMR").val(huyenmr);
                    $("#XAMR").empty();
                    $("#XAMR").append('<option value="' + '-1' + '">' +
                        '-- Chọn Xã --' + '</option>');
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("GetAdministrativeUnit1")', 
                        headers: {
                            'VerificationToken': '@GetAntiForgeryToken()'
                        },
                        dataType: 'json',

                        data: {
                            code: $("#HUYENMR").val(),
                            level: '3'
                        },

                        success: function (states) {
                            $.each(states, function (i, state) {
                                $("#XAMR").append('<option value="' + state.Value + '">' +
                                    state.Text + '</option>');
                            });

                        },
                        complete: function () {
                            $("#XAMR").val(codemr);
                            Check();

                        },
                        error: function (ex) {
                            alert('Failed to retrieve states.' + ex);
                        }
                    });
                },
                error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                }
            });
        } else {
            $("#HUYENMR").append('<option value="' + '-1' + '">' +
                '-- Chọn Huyện --' + '</option>');
            $("#XAMR").append('<option value="' + '-1' + '">' +
                 '-- Chọn Xã --' + '</option>');
        }
        if (codesp != "") {
            $("#TINHSP").val(tinhsp);
        }
        if ($("#TINHSP").val() != "-1") {
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAdministrativeUnit1")',
                headers: {
                    'VerificationToken': '@GetAntiForgeryToken()'
                },
                dataType: 'json',

                data: {
                    code: $("#TINHSP").val(),
                    level: '2'
                },
                success: function (states) {
                    $("#HUYENSP").append('<option value="' + '-1' + '">' +
                '-- Chọn Huyện --' + '</option>');
                    $.each(states, function (i, state) {
                        $("#HUYENSP").append('<option value="' + state.Value + '">' +
                             state.Text + '</option>');
                    });

                },
                complete: function () {
                    $("#HUYENSP").val(huyensp);
                    $("#XASP").empty();
                    $("#XASP").append('<option value="' + '-1' + '">' +
                        '-- Chọn Xã --' + '</option>');
                    $.ajax({
                        type: 'POST',
                        url: '@Url.Action("GetAdministrativeUnit1")', 
                        headers: {
                            'VerificationToken': '@GetAntiForgeryToken()'
                        },
                        dataType: 'json',

                        data: {
                            code: $("#HUYENSP").val(),
                            level: '3'
                        },
                        success: function (states) {
                            $.each(states, function (i, state) {
                                $("#XASP").append('<option value="' + state.Value + '">' +
                                    state.Text + '</option>');
                            });

                        },
                        complete: function () {
                            $("#XASP").val(codesp);
                            Check();
                        },
                        error: function (ex) {
                            alert('Failed to retrieve states.' + ex);
                        }
                    });
                },
                error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                }
            });
        }
        else {
            $("#HUYENSP").append('<option value="' + '-1' + '">' +
                '-- Chọn Huyện --' + '</option>');
            $("#XASP").append('<option value="' + '-1' + '">' +
                 '-- Chọn Xã --' + '</option>');
        }

        $(".MARITAL_STATUS_ID").change(function () {

            key = $(".MARITAL_STATUS_ID").val();
            $("#SPOUSES_LNAME").val('');
            $("#SPOUSES_MNAME").val('');
            $("#SPOUSES_FNAME").val('');
            $(".SPOUSES_COUNTRY_ID").val('');
            $("#XASP").val('');
            $(".SPOUSES_ETHNIC_ID").val('');
            $("#SPOUSES_IDCARD_NUM").val('');
            $("#MARRIAGE_REG_NUM").val('');
            $("#XAMR").val('');
            $("#DIV_REG_NUM").val('');
            $("#DIV_REG_BOOK_NUM").val('');
            $(".DIV_COURT_ID").val('');
            $("#DAYSP").val('');
            $("#MONTHSP").val('');
            $("#YEARSP").val('');
            $("#DAYMR").val('');
            $("#MONTHMR").val('');
            $("#YEARMR").val('');
            $("#DAYDI").val('');
            $("#MONTHDI").val('');
            $("#YEARDI").val('');
            $("#TINHMR").val('-1');
            $("#HUYENMR").val('');
            $("#XAMR").val('');
            $("#TINHSP").val('-1');
            $("#HUYENSP").val('');
            $("#XASP").val('');
            if (key == "1" || key == "0") {
                $("#dakethon").hide();
                $("#lyhon").hide();
                $("#thongtin").hide();
                $("#tt1").hide();
                $("#tt2").hide();
            }
            if (key == "2") {
                $("#dakethon").show();
                $("#lyhon").hide();
                $("#thongtin").show();
                $("#tt1").show();
                $("#tt2").hide();
                $("#HUYENMR").val("-1");
                $("#XAMR").val("-1");
                $("#HUYENSP").val("-1");
                $("#XASP").val("-1");
                $("#MARITAL_STATUS_ID").val("2");

            }
            if (key == "3") {
                $("#dakethon").hide();
                $("#lyhon").show();
                $("#thongtin").show();
                $("#tt1").hide();
                $("#tt2").show();
                $("#HUYENSP").val("-1");
                $("#XASP").val("-1");
                $("#MARITAL_STATUS_ID").val("3");
            }
            if (key == "") {
                $("#dakethon").hide();
                $("#lyhon").hide();
                $("#thongtin").hide();
                $("#tt1").hide();
                $("#tt2").hide();

            }

        });
        if (key == "1" || key == "0") {
            $("#dakethon").hide();
            $("#lyhon").hide();
            $("#thongtin").hide();
            $("#tt1").hide();
            $("#tt2").hide();
        }
        if (key == "2") {
            $("#dakethon").show(); key
            $("#lyhon").hide();
            $("#thongtin").show();
            $("#tt1").show();
            $("#tt2").hide();

        }
        if (key == "3") {
            $("#dakethon").hide();
            $("#lyhon").show();
            $("#thongtin").show();
            $("#tt1").hide();
            $("#tt2").show();
        }
        if (key == "") {
            $("#dakethon").hide();
            $("#lyhon").hide();
            $("#thongtin").hide();
            $("#tt1").hide();
            $("#tt2").hide();
        }


        $("#TINHMR").change(function () {
            $("#divLoading").show();
            $("#HUYENMR").empty();
            $("#XAMR").empty();
            $("#HUYENMR").append('<option value="' + '-1' + '">' +
                 '-- Chọn Huyện --' + '</option>');
            $("#XAMR").append('<option value="' + '-1' + '">' +
                 '-- Chọn Xã --' + '</option>');
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAdministrativeUnit1")', 
                headers: {
                    'VerificationToken': '@GetAntiForgeryToken()'
                },
                dataType: 'json',

                data: {
                    code: $("#TINHMR").val(),
                    level: '2'
                },
                success: function (states) {
                    $.each(states, function (i, state) {
                        $("#HUYENMR").append('<option value="' + state.Value + '">' +
                             state.Text + '</option>');
                    });

                },
                complete: function (states) {
                    $("#divLoading").hide();
                },
                error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                }
            });
            return false;
        })
        $("#HUYENMR").change(function () {
            $("#divLoading").show();
            $("#XAMR").empty();
            $("#XAMR").append('<option value="' + '-1' + '">' +
                '-- Chọn Xã --' + '</option>');
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAdministrativeUnit1")', 
                headers: {
                    'VerificationToken': '@GetAntiForgeryToken()'
                },
                dataType: 'json',

                data: {
                    code: $("#HUYENMR").val(),
                    level: '3'
                },
                success: function (states) {
                    $.each(states, function (i, state) {
                        $("#XAMR").append('<option value="' + state.Value + '">' +
                             state.Text + '</option>');

                    });

                },
                complete: function () {
                    $("#divLoading").hide();
                },
                error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                }
            });
            return false;
        });

        $("#TINHSP").change(function () {
            $("#divLoading").show();
            $("#HUYENSP").empty();
            $("#XASP").empty();
            $("#HUYENSP").append('<option value="' + '-1' + '">' +
                 '-- Chọn Huyện --' + '</option>');
            $("#XASP").append('<option value="' + '-1' + '">' +
                 '-- Chọn Xã --' + '</option>');
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAdministrativeUnit1")',
                headers: {
                    'VerificationToken': '@GetAntiForgeryToken()'
                },
                dataType: 'json',

                data: {
                    code: $("#TINHSP").val(),
                    level: '2'
                },
                success: function (states) {
                    $.each(states, function (i, state) {
                        $("#HUYENSP").append('<option value="' + state.Value + '">' +
                             state.Text + '</option>');
                    });

                },
                complete: function (states) {
                    $("#divLoading").hide();
                },
                error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                }
            });
            return false;
        })
        $("#HUYENSP").change(function () {
            $("#divLoading").show();
            $("#XASP").empty();
            $("#XASP").append('<option value="' + '-1' + '">' +
                '-- Chọn Xã --' + '</option>');
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetAdministrativeUnit1")',
                headers: {
                    'VerificationToken': '@GetAntiForgeryToken()'
                },
                dataType: 'json',

                data: {
                    code: $("#HUYENSP").val(),
                    level: '3'
                },
                success: function (states) {
                    $.each(states, function (i, state) {
                        $("#XASP").append('<option value="' + state.Value + '">' +
                             state.Text + '</option>');
                    });

                },
                complete: function () {
                    $("#divLoading").hide();
                },
                error: function (ex) {
                    alert('Failed to retrieve states.' + ex);
                }
            });
            return false;
        });
        $.ajax({
            url: '@Url.Action("GetAllByListName")',
            dataType: 'json',
            headers: {
                'VerificationToken': '@GetAntiForgeryToken()'
            },
            method: 'GET',
            data: { 'tablename': 'MARITAL_STATUS' },
            success: function (data, textStatus, jqXHR) {
                $(".MARITAL_STATUS_ID").append('<option value="">' +
             ' Chọn Tình trạng hôn nhân ' + '</option>');
                $.each(data, function (i, item) {
                    $(".MARITAL_STATUS_ID").append('<option value="' + item.CodeID + '">' +
                         item.Name + '</option>');
                });
                $(".MARITAL_STATUS_ID").val("@Model.MARITAL_STATUS_ID");
            },
            complete: function () {
                Check();
            }

        });
        $.ajax({
            url: '@Url.Action("GetAllByListName")',
            dataType: 'json',
            headers: {
                'VerificationToken': '@GetAntiForgeryToken()'
            },
            method: 'GET',
            data: { 'tablename': 'COUNTRY' },
            success: function (data, textStatus, jqXHR) {
                $(".SPOUSES_COUNTRY_ID").append('<option value="">' +
              '-- Chọn Quốc tịch --' + '</option>');
                $.each(data, function (i, item) {
                    $(".SPOUSES_COUNTRY_ID").append('<option value="' + item.CodeID + '">' +
                         item.Name + '</option>');
                });
                $(".SPOUSES_COUNTRY_ID").val("@Model.SPOUSES_COUNTRY_ID");
            },
            complete: function () {
                Check();
            }

        });
        $.ajax({
            url: '@Url.Action("GetAllByListName")',
            dataType: 'json',
            headers: {
                'VerificationToken': '@GetAntiForgeryToken()'
            },
            method: 'GET',
            data: { 'tablename': 'ETHNIC' },
            success: function (data, textStatus, jqXHR) {
                $(".SPOUSES_ETHNIC_ID").append('<option value="">' +
           '-- Chọn Dân tộc --' + '</option>');
                $.each(data, function (i, item) {
                    $(".SPOUSES_ETHNIC_ID").append('<option value="' + item.CodeID + '">' +
                         item.Name + '</option>');
                });
                $(".SPOUSES_ETHNIC_ID").val("@Model.SPOUSES_ETHNIC_ID");
            },
            complete: function () {
                Check();
            }

        });
        $.ajax({
            url: '@Url.Action("GetAllByListName")',
            dataType: 'json',
            headers: {
                'VerificationToken': '@GetAntiForgeryToken()'
            },
            method: 'GET',
            data: { 'tablename': 'COURT' },
            success: function (data, textStatus, jqXHR) {
                $(".DIV_COURT_ID").append('<option value="">' +
           '-- Chọn Tòa án --' + '</option>');
                $.each(data, function (i, item) {
                    $(".DIV_COURT_ID").append('<option value="' + item.CodeID + '">' +
                         item.Name + '</option>');
                });
                $(".DIV_COURT_ID").val("@Model.DIV_COURT_ID");
            },
            complete: function () {
                Check();
            }

        });
    });
    function ClickButton(Next) {
        $("#divLoading").show();
        var ngaysp = $("#DAYSP").val();
        var thangsp = $("#MONTHSP").val();
        var namsp = $("#YEARSP").val();
        var ngaymr = $("#DAYMR").val();
        var thangmr = $("#MONTHMR").val();
        var nammr = $("#YEARMR").val();
        var ngaydi = $("#DAYDI").val();
        var thangdi = $("#MONTHDI").val();
        var namdi = $("#YEARDI").val();
        xasp = $("#XASP").val();
        if (xasp == "-1") {
            xasp = "";
        }
        xamr = $("#XAMR").val();
        if (xamr == "-1") {
            xamr = "";
        }

        var dataSend = {
            'HOUSEHOLD_ID': $("#HOUSEHOLD_ID").val(),
            'RESIDENT_ID': $("#RESIDENT_ID").val(),
            'MARITAL_STATUS_ID': $(".MARITAL_STATUS_ID").val(),
            'SPOUSES_LNAME': $("#SPOUSES_LNAME").val(),
            'SPOUSES_MNAME': $("#SPOUSES_MNAME").val(),
            'SPOUSES_FNAME': $("#SPOUSES_FNAME").val(),
            'SPOUSES_DOB': namsp + thangsp + ngaysp,
            'SPOUSES_COUNTRY_ID': $(".SPOUSES_COUNTRY_ID").val(),
            'SPOUSES_RPOB_ADM_UNIT_ID': xasp,
            'SPOUSES_ETHNIC_ID': $(".SPOUSES_ETHNIC_ID").val(),
            'SPOUSES_IDCARD_NUM': $("#SPOUSES_IDCARD_NUM").val(),
            'MARRIAGE_REG_DAY': nammr + thangmr + ngaymr,
            'MARRIAGE_REG_NUM': $("#MARRIAGE_REG_NUM").val(),
            'MRE_REG_ADM_UNIT_ID': xamr,
            'DIV_REG_NUM': $("#DIV_REG_NUM").val(),
            'DIV_REG_BOOK_NUM': $("#DIV_REG_BOOK_NUM").val(),
            'DIV_COURT_ID': $(".DIV_COURT_ID").val(),
            'DIV_REG_DAY': namdi + thangdi + ngaydi,
            'NEXT': Next,
        };
        var jqXHR = $.ajax({
            url: '@Url.Action("TinhTrangHonNhan","Online")',
            dataType: 'html',
            headers: {
                'VerificationToken': '@GetAntiForgeryToken()'
            },
            method: 'post',
            cache: false,
            data: dataSend,
            success: function myfunctionSuccess(data, textStatus, jqXHR) {
                if (Next == "2") {
                    $('#formLogin').html(data);
                }
                else {
                    $('#loadPartial').html(data);
                }
            },
            complete: function (jqXHR, textStatus) {
                $("#divLoading").hide();
                $("#btnNext").removeAttr("disabled");
                $("#btnBack").removeAttr("disabled");
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert('Có lỗi xảy ra trong quá trình lưu thông tin: ' + errorThrown);
            },

        });
    }
    function Check() {
        var COUNTRY_ID = $(".SPOUSES_COUNTRY_ID").val();
        var ETHNIC_ID = $(".SPOUSES_ETHNIC_ID").val();
        var SPOUSES_RPOB_ADM_UNIT_ID = $("#XASP").val();
        if (SPOUSES_RPOB_ADM_UNIT_ID == "-1") {
            SPOUSES_RPOB_ADM_UNIT_ID = "";
        }
        var MRE_REG_ADM_UNIT_ID = $("#XAMR").val();
        if (MRE_REG_ADM_UNIT_ID == "-1") {
            MRE_REG_ADM_UNIT_ID = "";
        }
        var mar = $(".MARITAL_STATUS_ID").val();
        var mar1 = $(".DIV_COURT_ID").val();
        var coun = $("#SPOUSES_COUNTRY_ID").val();
        var coun1 = $("#SPOUSES_ETHNIC_ID").val();
        var coun2 = $("#MARITAL_STATUS_ID").val();
        var coun3 = $("#DIV_COURT_ID").val();
        if (mar == "0" || mar == "1" || mar == "") {
            $("#divLoading").hide();
            $("#btnNext").removeAttr("disabled");
            $("#btnBack").removeAttr("disabled");
        }
        else {
            if (COUNTRY_ID == coun && ETHNIC_ID == coun1 && SPOUSES_RPOB_ADM_UNIT_ID == codesp && MRE_REG_ADM_UNIT_ID == codemr && mar == coun2 && mar1 == coun3) {
                $("#divLoading").hide();
                $("#btnNext").removeAttr("disabled");
                $("#btnBack").removeAttr("disabled");
            } else {
                $("#divLoading").show();
                $("#btnNext").attr("disabled", "disabled");
                $("#btnBack").attr("disabled", "disabled");
            }
        }


    };
    $("#btnNext").click(function (event, giatri) {
        if (checkhtml()) {
            alert("Dữ liệu nhập không được có ký tự '<' ở đầu.");
        } else {
            if (giatri != null) {
                ClickButton(giatri);
            }
            else {
                if (key == "2") {
                    if (Checkdatetime("DAYMR", "MONTHMR", "YEARMR") == 0 && Checkdatetime("DAYSP", "MONTHSP", "YEARSP") == 0) {
                        ClickButton(1);
                    }
                }
                else {
                    if (key == "3") {
                        if (Checkdatetime("DAYDI", "MONTHDI", "YEARDI") == 0 && Checkdatetime("DAYSP", "MONTHSP", "YEARSP") == 0) {
                            ClickButton(1);
                        }
                    }
                    else {
                        ClickButton(1);
                    }
                }

            }
        }
    });
    $("#btnBack").click(function () {
        if (checkhtml()) {
            alert("Dữ liệu nhập không được có ký tự '<' ở đầu.");
        } else {
            ClickButton(0);
        }
    });

</script>
<div class="noidung-nhaponline">
    <div class="login-fields2">
        <p style="float: left; padding-right: 5px; vertical-align: top;">
            <img src="../Images/rt_arrow.gif">
        <p>Thông tin Tình trạng hôn nhân:</p>
    </div>
    <div class="row row-online-table-head">
        <div class="col-md-2 lbldai ">
            @Html.LabelFor(m => m.MARITAL_STATUS_ID, new { @class = "control-lable" })
        </div>
        <div class="col-md-4 controldai">
            <select class="MARITAL_STATUS_ID form-control " tabindex="1"></select>
        </div>
    </div>
    <div id="dakethon">
        <div class="row row-online-table1">
            <div class="col-md-2 lbldai">
                @Html.LabelFor(m => m.MARRIAGE_REG_NUM, new { @class = "control-lable" })
            </div>
            <div class="col-md-4 controldai">
                @Html.TextBoxFor(model => model.MARRIAGE_REG_NUM, new { @class = "form-control ", MaxLength = 25, Tabindex = 2 })
            </div>
            <div class="col-md-2 lbldai">
                @Html.LabelFor(m => m.MARRIAGE_REG_DAY, new { @class = "control-lable" })
            </div>
            <div class="col-md-4 controldai">
                @Html.TextBoxFor(model => model.DAYMR, new { @class = "form-control", style = "width: 25%; display: inline;", MaxLength = 2, Tabindex = 3, @title = @Html.ToolTipMessageFor(m => m.DAYMR) })/@Html.TextBoxFor(model => model.MONTHMR, new { @class = "form-control", style = "width: 25%; display: inline;", MaxLength = 2, Tabindex = 4, @title = @Html.ToolTipMessageFor(m => m.MONTHMR) })/@Html.TextBoxFor(model => model.YEARMR, new { @class = "form-control", style = "width: 45%; display: inline;", MaxLength = 4, Tabindex = 5, @title = @Html.ToolTipMessageFor(m => m.YEARMR) })
            </div>

        </div>
        <div class="row row-online-table1">
            <div class="col-md-3 lbldai">
                @Html.LabelFor(model => model.MRE_REG_ADM_UNIT_ID, new { @class = "control-label " })
            </div>
            <div class="col-md-3 widthTinhHuyenXadai">
                @Html.DropDownList("TINHMR", ViewData["DISTRICT_CODE"] as List<SelectListItem>, new { @class = "form-control", Tabindex = 6, @title = @Html.ToolTipMessageFor(m => m.TINHMR) })

            </div>
            <div class="col-md-3 widthTinhHuyenXadai">
                @Html.DropDownList("HUYENMR", new SelectList(string.Empty, "Value", "Text"), new { @class = "form-control", Tabindex = 7, @title = @Html.ToolTipMessageFor(m => m.HUYENMR) })
            </div>
            <div class="col-md-3 widthTinhHuyenXadai">
                @Html.DropDownList("XAMR", new SelectList(string.Empty, "Value", "Text"), new { @class = "form-control", Tabindex = 8, @title = @Html.ToolTipMessageFor(m => m.XAMR) })
            </div>
        </div>
    </div>
    <div id="lyhon">

        <div class="row row-online-table1">
            <div class="col-md-2 lbldai">
                @Html.LabelFor(model => model.DIV_REG_NUM, new { @class = "control-label " })
            </div>
            <div class="col-md-4 controldai">
                @Html.TextBoxFor(model => model.DIV_REG_NUM, new { @class = "form-control ", MaxLength = 25, Tabindex = 9 })
            </div>
            <div class="col-md-2 lbldai">
                @Html.LabelFor(model => model.DIV_REG_BOOK_NUM, new { @class = "control-label " })
            </div>
            <div class="col-md-4 controldai">
                @Html.TextBoxFor(model => model.DIV_REG_BOOK_NUM, new { @class = "form-control ", MaxLength = 25, Tabindex = 10 })
            </div>
        </div>
        <div class="row row-online-table1">
            <div class="col-md-2 lbldai">
                @Html.LabelFor(m => m.DIV_REG_DAY, new { @class = "control-lable" })
            </div>
            <div class="col-md-4 controldai">
                @Html.TextBoxFor(model => model.DAYDI, new { @class = "form-control", style = "width: 25%; display: inline;", MaxLength = 2, Tabindex = 11, @title = @Html.ToolTipMessageFor(m => m.DAYDI) })/@Html.TextBoxFor(model => model.MONTHDI, new { @class = "form-control", style = "width: 25%; display: inline;", MaxLength = 2, Tabindex = 12, @title = @Html.ToolTipMessageFor(m => m.MONTHDI) })/@Html.TextBoxFor(model => model.YEARDI, new { @class = "form-control", style = "width: 45%; display: inline;", MaxLength = 4, Tabindex = 13, @title = @Html.ToolTipMessageFor(m => m.YEARDI) })
            </div>
            <div class="col-md-2 lbldai">
                @Html.LabelFor(m => m.DIV_COURT_ID, new { @class = "control-lable" })
            </div>
            <div class="col-md-4 controldai">
                <select class="DIV_COURT_ID form-control " tabindex="14"></select>
            </div>
        </div>
    </div>
    <br />
    <div class="login-fields2" id="tt1">
        <p style="float: left; padding-right: 5px; vertical-align: top;">
            <img src="../Images/rt_arrow.gif">
        <p>Thông tin vợ/chồng:</p>
    </div>
    <div class="login-fields2" id="tt2">
        <p style="float: left; padding-right: 5px; vertical-align: top;">
            <img src="../Images/rt_arrow.gif">
        <p>Thông tin vợ/chồng đã ly hôn:</p>
    </div>
    <br />

    <div id="thongtin">
        <div class="row row-online-table1">
            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_LNAME, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.SPOUSES_LNAME, new { @class = "form-control ", MaxLength = 50, Tabindex = 15 })
            </div>
            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_IDCARD_NUM, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.SPOUSES_IDCARD_NUM, new { @class = "form-control ", MaxLength = 12, Tabindex = 21, @title = @Html.ToolTipMessageFor(m => m.SPOUSES_IDCARD_NUM) })
            </div>
        </div>
        <div class="row row-online-table1">
            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_MNAME, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.SPOUSES_MNAME, new { @class = "form-control ", MaxLength = 150, Tabindex = 16 })
            </div>
            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_COUNTRY_ID, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                <select class="SPOUSES_COUNTRY_ID form-control" tabindex="22"></select>
            </div>
        </div>
        <div class="row row-online-table1">

            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_FNAME, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.SPOUSES_FNAME, new { @class = "form-control ", MaxLength = 50, Tabindex = 17 })
            </div>
            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_ETHNIC_ID, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                <select class="SPOUSES_ETHNIC_ID form-control " tabindex="23"></select>
            </div>
        </div>
        <div class="row row-online-table1">
            <div class="col-md-2">
                @Html.LabelFor(model => model.SPOUSES_DOB, new { @class = "control-label " })
            </div>
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.DAYSP, new { @class = "form-control", style = "width: 20%; display: inline;", MaxLength = 2, Tabindex = 18, @title = @Html.ToolTipMessageFor(m => m.DAYSP) })/@Html.TextBoxFor(model => model.MONTHSP, new { @class = "form-control", style = "width: 20%; display: inline;", MaxLength = 2, Tabindex = 19, @title = @Html.ToolTipMessageFor(m => m.MONTHSP) })/@Html.TextBoxFor(model => model.YEARSP, new { @class = "form-control", style = "width: 40%; display: inline;", MaxLength = 4, Tabindex = 20, @title = @Html.ToolTipMessageFor(m => m.YEARSP) })
            </div>

        </div>
        <div class="row row-online-table1">
            <div class="col-md-3 widthlabelTinhHuyenXa">
                @Html.LabelFor(model => model.SPOUSES_RPOB_ADM_UNIT_ID, new { @class = "control-label " })
            </div>
            <div class="col-md-3 widthTinhHuyenXa">
                @Html.DropDownList("TINHSP", ViewData["DISTRICT_CODE"] as List<SelectListItem>, new { @class = "form-control", Tabindex = 24, @title = @Html.ToolTipMessageFor(m => m.TINHSP) })

            </div>
            <div class="col-md-3 widthTinhHuyenXa">
                @Html.DropDownList("HUYENSP", new SelectList(string.Empty, "Value", "Text"), new { @class = "form-control", Tabindex = 25, @title = @Html.ToolTipMessageFor(m => m.HUYENSP) })
            </div>
            <div class="col-md-3 widthTinhHuyenXa">
                @Html.DropDownList("XASP", new SelectList(string.Empty, "Value", "Text"), new { @class = "form-control", Tabindex = 26, @title = @Html.ToolTipMessageFor(m => m.XASP) })
            </div>
        </div>
    </div>
    <div>
        @Html.HiddenFor(model => model.RESIDENT_ID)
        @Html.HiddenFor(model => model.HOUSEHOLD_ID)
        @Html.HiddenFor(model => model.MARITAL_STATUS_ID)
        @Html.HiddenFor(model => model.CODEMR)
        @Html.HiddenFor(model => model.CODESP)
        @Html.HiddenFor(model => model.SPOUSES_ETHNIC_ID)
        @Html.HiddenFor(model => model.SPOUSES_COUNTRY_ID)
        @Html.HiddenFor(model => model.DIV_COURT_ID)

    </div>
    <center>
        <input type="button" class="btn btn-small btn-small_online btn-success buttonClick" tabindex="27" id="btnBack" value="<< Quay lại">
        <input type="button" class="btn btn-small btn-small_online btn-success buttonClick" tabindex="28" id="btnNext" value="Tiếp tục >>">
    </center>

</div>
